home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL-ftn / fglupickmatrix.z / fglupickmatrix
Encoding:
Text File  |  2002-10-03  |  5.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx((((3333GGGG))))             OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee             ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx - define a picking region
  10.  
  11.  
  12. FFFFOOOORRRRTTTTRRRRAAAANNNN SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      SUBROUTINE ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx( REAL*4 _x,
  14.                                 REAL*4 _y,
  15.                                 REAL*4 _d_e_l_X,
  16.                                 REAL*4 _d_e_l_Y,
  17.                                 CHARACTER*8 _v_i_e_w_p_o_r_t )
  18.  
  19.  
  20. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  21.      _x, _y Specify the center of a picking region in window coordinates.
  22.  
  23.      _d_e_l_X, _d_e_l_Y
  24.           Specify the width and height, respectively, of the picking region in
  25.           window coordinates.
  26.  
  27.      _v_i_e_w_p_o_r_t
  28.           Specifies the current viewport (as from a ggggllllGGGGeeeettttIIIInnnntttteeeeggggeeeerrrrvvvv call).
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx creates a projection matrix that can be used to restrict
  32.      drawing to a small region of the viewport.  This is typically useful to
  33.      determine what objects are being drawn near the cursor.  Use
  34.      ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx to restrict drawing to a small region around the cursor.
  35.      Then, enter selection mode (with ggggllllRRRReeeennnnddddeeeerrrrMMMMooooddddeeee) and rerender the scene.
  36.      All primitives that would have been drawn near the cursor are identified
  37.      and stored in the selection buffer.
  38.  
  39.      The matrix created by ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx is multiplied by the current matrix
  40.      just as if ggggllllMMMMuuuullllttttMMMMaaaattttrrrriiiixxxx is called with the generated matrix.  To
  41.      effectively use the generated pick matrix for picking, first call
  42.      ggggllllLLLLooooaaaaddddIIIIddddeeeennnnttttiiiittttyyyy to load an identity matrix onto the perspective matrix
  43.      stack.  Then call ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx, and finally, call a command (such as
  44.      ffffgggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee) to multiply the perspective matrix by the pick matrix.
  45.  
  46.      When using ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx to pick NURBS, be careful to turn off the NURBS
  47.      property GGGGLLLLUUUU____AAAAUUUUTTTTOOOO____LLLLOOOOAAAADDDD____MMMMAAAATTTTRRRRIIIIXXXX.  If GGGGLLLLUUUU____AAAAUUUUTTTTOOOO____LLLLOOOOAAAADDDD____MMMMAAAATTTTRRRRIIIIXXXX is not turned
  48.      off, then any NURBS surface rendered is subdivided differently with the
  49.      pick matrix than the way it was subdivided without the pick matrix.
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx((((3333GGGG))))             OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee             ffffgggglllluuuuPPPPiiiicccckkkkMMMMaaaattttrrrriiiixxxx((((3333GGGG))))
  71.  
  72.  
  73.  
  74. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  75.      When rendering a scene as follows:
  76.  
  77.  
  78.           glMatrixMode(GL_PROJECTION);
  79.           glLoadIdentity();
  80.           gluPerspective(...);
  81.           glMatrixMode(GL_MODELVIEW);
  82.           /* Draw the scene */
  83.  
  84.  
  85.      a portion of the viewport can be selected as a pick region like this:
  86.  
  87.  
  88.           glMatrixMode(GL_PROJECTION);
  89.           glLoadIdentity();
  90.           gluPickMatrix(x, y, width, height, viewport);
  91.           gluPerspective(...);
  92.           glMatrixMode(GL_MODELVIEW);
  93.           /* Draw the scene */
  94.  
  95.  
  96. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  97.      ggggllllGGGGeeeetttt, ggggllllLLLLooooaaaaddddIIIInnnnddddeeeennnnttttiiiittttyyyy, ggggllllMMMMuuuullllttttMMMMaaaattttrrrriiiixxxx, ggggllllRRRReeeennnnddddeeeerrrrMMMMooooddddeeee, ffffgggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.